<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>返回文档中第一个锚的 innerHTML</title>
</head>

<body>
    <a name="html">HTML 教程</a><br>
    <a name="css">CSS 教程</a><br>
    <a name="xml">XML 教程</a>

    <p>文档中第一个锚:
        <script>
            document.write(document.anchors[0].innerHTML);
        </script>
</body>

</html>